#include <vector>
#include<iostream>
using namespace std;
class Solution
{
public:
    int countTriplets(vector<int> &arr)
    {
        int len = arr.size();
        vector<vector<int>> datas(len, vector<int>(len));
        for (int i = 0; i < len; i++)
        {
            for (int j = i; j < len; j++)
            {
                if (j == i)
                {
                    datas[i][j] = arr[j];
                }
                else
                {
                    datas[i][j] = arr[j] ^ datas[i][j - 1];
                }
            }
        }
        int count = 0;
        for (int i = 0; i < len; i++)
        {
            for (int j = i+1; j < len; j++)
            {
                for (int k = j; k < len; k++)
                {
                    if(datas[i][j-1] == datas[j][k]){
                        count++;
                    }
                }
                
            }
            
        }
        return count;
        
    }
};

int main(int argc, char const *argv[])
{
    vector<int> v({2,3});
    Solution s;
    cout << s.countTriplets(v) << endl;    

    return 0;
}
